<?php
/* @var $this OverviewController */
/* @var $dataProvider CActiveDataProvider */

$this->breadcrumbs=array(
	'Waarnemingen Overzicht',
);
?>

<h1>Waarnemingenoverzicht</h1>

<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'page-form',
    'enableAjaxValidation'=>true,
)); ?>

<?php
// Searching date range: http://www.yiiframework.com/wiki/345/how-to-filter-cgridview-with-from-date-and-to-date-datepicker/
?>
<b>Van :</b>
<?php
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
    'name'=>'from_date',  // name of post parameter
    'value'=>(isset(Yii::app()->request->cookies['from_date'])?Yii::app()->request->cookies['from_date']->value:''),  // value comes from cookie after submission
     'options'=>array(
        'showAnim'=>'fold',
        'dateFormat'=>'dd-mm-yy', // Optional date formatting
        'maxDate'=>'0',
    ),
    'htmlOptions'=>array(
        'style'=>'height:20px;'
    ),
));
?>
<b>Tot :</b>
<?php
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
    'name'=>'to_date',
    'value'=>(isset(Yii::app()->request->cookies['to_date'])?Yii::app()->request->cookies['to_date']->value:''), // value comes from cookie after submission
     'options'=>array(
        'showAnim'=>'fold',
        'dateFormat'=>'dd-mm-yy',
        'maxDate'=>'0',
 
    ),
    'htmlOptions'=>array(
        'style'=>'height:20px;'
    ),
));
?>
<?php echo CHtml::submitButton('Zoek'); ?>
<?php $this->endWidget(); ?>

<?php 
$this->widget('zii.widgets.grid.CGridView', array(
    'dataProvider' => $model->search(),
    'columns' => array(
        array(
//          'name'=>'observationDateInput', // name refers to the attribute
          'value'=>'$data->observationDateInput', // value refers to the value returned by the PHP expression
          'sortable'=>true,
        ),
        'seeing',
        'transparency',
        'wolff',
        array(
            'class'=>'CButtonColumn',
            'template'=>'{view}',
        ),
    ),
));
?>
